home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / sml_nj / 93src.lha / src / coder / emitter.sig < prev    next >
Encoding:
Text File  |  1993-01-27  |  1.2 KB  |  38 lines

  1. (* emitter.sig
  2.  *
  3.  * Copyright 1989 by AT&T Bell Laboratories
  4.  *
  5.  * This is the signature of the assembler and machine code emitters.
  6.  *
  7.  * AUTHOR:  John Reppy
  8.  *        Cornell University
  9.  *        Ithaca, NY 14853
  10.  *        jhr@cs.cornell.edu
  11.  *)
  12.  
  13. signature EMITTER =
  14. sig
  15.     datatype 'label info = INFO of {addrOf: 'label -> int, 
  16.                     nameOf: 'label->string}
  17.     type 'label instruction
  18.  
  19.     val emitLong : int -> unit              (* emit an integer constant *)
  20.     val emitString : string -> unit         (* emit a (padded) string constant *)
  21.     val emitReal : string -> unit           (* emit a real constant *)
  22. (* NOTE: the following is useful for asm code, but could be replaced by
  23.  * emitLong. *)
  24.     val emitAddr : 'label info -> ('label * int) -> unit    
  25.                      (* emit a label value (with offset) *)
  26.  
  27.     val define : 'label info -> 'label -> unit   (* define a label *)
  28.     val mark : unit -> unit                 (* emit a back-pointer mark *)
  29.  
  30.     val emitInstr : 'label info -> 'label instruction -> unit
  31.                          (* emit an instruction *)
  32.  
  33.     val comment : string -> unit
  34.  
  35.     val init : int -> unit                  (* initialize to emit n bytes of code *)
  36.  
  37. end (* signature EMITTER *)
  38.